import request from '@/utils/request'

// 查询竞赛详情详细
export function getCompetitionDetail(id) {
  return request({
    url: '/race/competitionDetail/' + id,
    method: 'get'
  })
}

// 根据竞赛ID查询竞赛详情
export function getCompetitionDetailByCompetitionId(competitionId) {
  return request({
    url: '/race/competitionDetail/competition/' + competitionId,
    method: 'get'
  })
}

// 根据竞赛ID获取赛制信息
export function getCompetitionRules(competitionId) {
  return request({
    url: '/race/competitionDetail/competition/' + competitionId + '/rules',
    method: 'get'
  })
}

// 新增竞赛详情
export function addCompetitionDetail(data) {
  return request({
    url: '/race/competitionDetail',
    method: 'post',
    data: data
  })
}

// 修改竞赛详情
export function updateCompetitionDetail(data) {
  return request({
    url: '/race/competitionDetail',
    method: 'put',
    data: data
  })
}

// 删除竞赛详情
export function delCompetitionDetail(id) {
  return request({
    url: '/race/competitionDetail/' + id,
    method: 'delete'
  })
}
